package com.hyts.reactive.module;

import com.hyts.reactive.listener.item.BaseEventListener;
import lombok.AllArgsConstructor;
import reactor.core.publisher.Flux;

/**
 * project-name:coffice-toolbox
 * package-name:com.hyts.reactive.module
 * author:Libo/Alex
 * create-date:2019-07-17 14:42
 * email:liboware@gmail.com
 * description: base subscription
 */
@AllArgsConstructor
public class BaseSubscription implements Subscription<BaseEventListener,Object>{

    Flux<?> param;

    @Override
    public Object bind(BaseEventListener eventListener) {
        param.subscribe(eventListener::onEvent,eventListener::onError,eventListener::onFinish);
        return null;
    }

}
